/*
 * Copyright (C) 2011 Jesus Navalon i Pastor <jnavalon at redhermes dot net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * pn_ListCellRendererDisk.java
 *
 * Created on 23/09/2011, 15:10:43
 */
package kuasar.plugin.servermanager.gui.infoserver;

/**
 *
 * @author Jesus Navalon i Pastor <jnavalon at redhermes dot net>
 */
public class pn_ListCellRendererDisk extends javax.swing.JPanel {

    /** Creates new form pn_ListCellRendererDisk */
    public pn_ListCellRendererDisk() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_Path = new javax.swing.JLabel();
        pb_Size = new javax.swing.JProgressBar();
        lbl_Free = new javax.swing.JLabel();
        lbl_Used = new javax.swing.JLabel();
        lbl_Total = new javax.swing.JLabel();
        lbl_UsedSize = new javax.swing.JLabel();
        lbl_FreeSize = new javax.swing.JLabel();
        lbl_TotalSize = new javax.swing.JLabel();
        lbl_Type = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        setOpaque(false);

        lbl_Path.setForeground(new java.awt.Color(204, 204, 204));
        lbl_Path.setText("/");

        pb_Size.setValue(50);
        pb_Size.setStringPainted(true);

        lbl_Free.setForeground(new java.awt.Color(204, 204, 204));
        lbl_Free.setText("Free:");

        lbl_Used.setForeground(new java.awt.Color(204, 204, 204));
        lbl_Used.setText("Used:");

        lbl_Total.setForeground(new java.awt.Color(204, 204, 204));
        lbl_Total.setText("Total:");

        lbl_UsedSize.setFont(new java.awt.Font("Dialog", 0, 12));
        lbl_UsedSize.setForeground(new java.awt.Color(204, 204, 204));

        lbl_FreeSize.setFont(new java.awt.Font("Dialog", 0, 12));
        lbl_FreeSize.setForeground(new java.awt.Color(204, 204, 204));

        lbl_TotalSize.setFont(new java.awt.Font("Dialog", 0, 12));
        lbl_TotalSize.setForeground(new java.awt.Color(204, 204, 204));

        lbl_Type.setForeground(new java.awt.Color(204, 204, 204));
        lbl_Type.setText("[<FS Type>]");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lbl_Path, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pb_Size, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lbl_Type)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 123, Short.MAX_VALUE)
                        .addComponent(lbl_Free)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbl_FreeSize)
                        .addGap(18, 18, 18)
                        .addComponent(lbl_Used)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbl_UsedSize)
                        .addGap(18, 18, 18)
                        .addComponent(lbl_Total)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbl_TotalSize)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(pb_Size, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)
                    .addComponent(lbl_Path, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_Free)
                    .addComponent(lbl_FreeSize)
                    .addComponent(lbl_Used)
                    .addComponent(lbl_UsedSize)
                    .addComponent(lbl_Total)
                    .addComponent(lbl_TotalSize)
                    .addComponent(lbl_Type))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lbl_Free;
    private javax.swing.JLabel lbl_FreeSize;
    private javax.swing.JLabel lbl_Path;
    private javax.swing.JLabel lbl_Total;
    private javax.swing.JLabel lbl_TotalSize;
    private javax.swing.JLabel lbl_Type;
    private javax.swing.JLabel lbl_Used;
    private javax.swing.JLabel lbl_UsedSize;
    private javax.swing.JProgressBar pb_Size;
    // End of variables declaration//GEN-END:variables

    public void setProgressValue(int value){
        pb_Size.setValue(value);
    }
    
    public void setPath(String path){
        lbl_Path.setText(path);
    }
    public void setTotal(String size){
        lbl_TotalSize.setText(size);
    }
    public void setFree(String size){
        lbl_FreeSize.setText(size);
    }
    public void setUsed(String size){
        lbl_UsedSize.setText(size);
    }
    public void setType(String type){
        lbl_Type.setText(type);
    }
    public void setSelected(){
        setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
    }
}
